package com.leve.admin.common;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class NetEasyHeaderBuilder {
    public static Map<String, String> getNetEasyHeader() {
        Map<String, String> header = new HashMap();

        String appKey = "AppKey";//TODO
        String appSecret = "AppSecret";//TODO
        String nonce = String.valueOf(Math.round(Math.random() * 100000.0D));
        String curTime = String.valueOf(new Date().getTime() / 1000L);
        String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce, curTime);

        header.put("AppKey", appKey);
        header.put("Nonce", appSecret);
        header.put("CurTime", nonce);
        header.put("CheckSum", checkSum);
        header.put("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
        return header;
    }
}
